---
title: Search Examples
description: Quick examples and interactive tutorials for search
edit-this-page-url: https://github.com/airweave-ai/airweave/blob/main/fern/docs/pages/search/examples.mdx

---

This page provides quick examples to get you started with Airweave search. For a comprehensive, hands-on tutorial with visualizations and real-world scenarios, check out our interactive Jupyter notebook.

<Tip title="Interactive Tutorial">
  Learn search concepts through hands-on examples in our comprehensive Jupyter notebook with live code, visualizations, and real-world scenarios.

  [View the Advanced Search Tutorial →](https://github.com/airweave-ai/airweave/blob/main/examples/04_advanced_search_with_filters.ipynb)
</Tip>

## Quick Start

```python
from airweave import AirweaveSDK
from airweave.schemas.search import SearchRequest
from qdrant_client.http.models import Filter, FieldCondition, MatchValue

client = AirweaveSDK(api_key="your-api-key")
```

## Essential Examples

### Basic Search

```python
# Simple text search
response = await client.collections.search_collection(
    readable_id="your-collection-id",
    query="customer onboarding process"
)
```

### Search with AI Completion

```python
# Get AI-generated insights
response = await client.collections.search_collection(
    readable_id="your-collection-id",
    query="What are our security policies?",
    response_type="completion"
)
```

### Filtered Search

```python
# Search within specific source (⚠️ case-sensitive!)
request = SearchRequest(
    query="API documentation",
    filter=Filter(
        must=[
            FieldCondition(
                key="source_name",
                match=MatchValue(value="GitHub")  # Must match exactly
            )
        ]
    )
)

response = await client.collections.search_collection_advanced(
    readable_id="your-collection-id",
    search_request=request
)
```

### Date Range Filter

```python
from datetime import datetime, timezone, timedelta
from qdrant_client.http.models import DatetimeRange

# Find items from last 7 days
request = SearchRequest(
    query="bug fixes",
    filter=Filter(
        must=[
            FieldCondition(
                key="created_at",
                range=DatetimeRange(
                    gte=datetime.now(timezone.utc) - timedelta(days=7)
                )
            )
        ]
    )
)
```

### Case-Insensitive Source Matching

```python
from qdrant_client.http.models import MatchAny

# Handle different case variations
request = SearchRequest(
    query="deployment guide",
    filter=Filter(
        must=[
            FieldCondition(
                key="source_name",
                match=MatchAny(any=["GitHub", "github", "GITHUB"])
            )
        ]
    )
)
```

### REST API

<Tip>
Try the advanced search endpoint with filters in our interactive API playground.
[Open API Explorer →](/api-reference/collections/search-collection-advanced-collections-readable-id-search-post?explorer=true)
</Tip>

```bash
# GET - Basic search
curl -X GET "https://api.airweave.ai/collections/{id}/search?query=test" \
  -H "x-api-key: your-api-key"

# POST - Advanced search with filters
curl -X POST "https://api.airweave.ai/collections/{id}/search" \
  -H "x-api-key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "query": "security vulnerabilities",
    "filter": {
      "must": [{
        "key": "source_name",
        "match": {"value": "GitHub"}
      }]
    },
    "score_threshold": 0.7
  }'
```

### Filter Patterns

This is a hypothetical example of what you might want to do.

```python
# Multi-source search
FieldCondition(
    key="source_name",
    match=MatchAny(any=["Asana", "Jira", "Linear"])
)

# Priority filtering
FieldCondition(
    key="metadata.priority",
    match=MatchAny(any=["high", "critical", "P0"])
)

# Exclude resolved items
Filter(
    must_not=[
        FieldCondition(
            key="metadata.status",
            match=MatchAny(any=["closed", "resolved", "done"])
        )
    ]
)
```

## Learn More

- **[Search Concepts](/search/concepts)** - Understand parameters and options
- **[Using Filters](/search/filters)** - Master Qdrant filtering
- **[API Reference](/api-reference/collections/search-collection-collections-readable-id-search-get)** - Complete API details
- **[Interactive Tutorial ↗](https://github.com/airweave-ai/airweave/blob/main/examples/04_advanced_search_with_filters.ipynb)** - Hands-on Jupyter notebook with visualizations
